<!DOCTYPE html>
<html>
<head>
<title>编辑模型</title>
#include("../include/common.html")
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>编辑模型</h5>
            </div>
           <form id="inputForm" action="update" method="post">
           		<input type="hidden" name="id" value="#(model.id)" />
	            <div class="ibox-content">
	                <div class="form-horizontal clearfix">
	                    <div class="form-group">
	                        <label class="col-sm-3 control-label">名称：</label>
	                        <div class="col-sm-3">
	                            <input class="form-control" type="text" name="name" value="#(model.name)">
	                        </div>
	                    </div>
	                    <div class="form-group">
                            <label class="col-sm-3 control-label">类型：</label>
                            <div class="col-sm-3">
                                #if(model.type==1) 栏目 #else if(model.type==2) 表单 #else if(model.type==3) 自定义表  #end
                            </div>
                            <input class="form-control" type="text" name="type" value="#(model.type)" hidden="hidden">
                        </div>
                        #if(model.type==1)
                        <div class="form-group">
                            <label class="col-sm-3 control-label">列表模板：</label>
                            <div class="col-sm-3">
                                <input class="form-control" type="text" name="listTemplate" value="#(model.listTemplate)">
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>例如：news_list.html。不填写则会是:模型名称拼音小写_list.html</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">内容模板：</label>
                            <div class="col-sm-3">
                                <input class="form-control" type="text" name="contentTemplate" value="#(model.contentTemplate)">
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>例如：news_detail.html。不填写则会是:模型名称拼音小写_detail.html</span>
                            </div>
                        </div>
                        #end
                        #if(model.type==2)
                        <div class="form-horizontal clearfix">
                            <div class="form-group">
                                <label class="col-sm-3 control-label">是否需要验证码：</label>
                                <div class="col-sm-3">
                                    <div class="radio">
                                        <label class="m-r"><input name="isCaptcha" value="true" type="radio" #if(model.isCaptcha) checked #end>是</label>
                                        <label class="m-r"><input name="isCaptcha" value="false" type="radio" #if(!model.isCaptcha) checked #end>否</label>
                                    </div>
                                </div>
                            </div>
                        </div>
                        #end
	                </div>
	            </div>
	            <div class="modal-footer col-sm-3 col-sm-offset-2">
	                <button type="submit" class="btn btn-w-m btn-primary">确定</button>
	                <button type="button" class="btn btn-w-m btn-default" onclick="history.back(); return false;">取消</button>
	            </div>
            </form>
        </div>
    </div>
</body>
</html>
<script type="text/javascript">
$().ready(function() {

	var $inputForm = $("#inputForm");
	
	// 表单验证
	$inputForm.validate({
		rules: {
			name: "required"
		}
	});

});
</script>